package Song.Han.demo04;

import java.util.HashMap;
import java.util.LinkedHashMap;

/*
* 底层：哈希表+链表
* */
public class Demo02LinkedHashMap {
    public static void main(String[] args) {
        HashMap<String,String> map = new HashMap<>();
        map.put("a","a");
        map.put("c","c");
        map.put("d","d");
        map.put("b","b");
        System.out.println(map);//无序

        LinkedHashMap<String,String> linked = new LinkedHashMap<>();
        linked.put("a","a");
        linked.put("c","c");
        linked.put("d","d");
        linked.put("b","b");
        System.out.println(linked);
    }
}
